From 22c254af74a78039f5b8cc6238494efb09136643 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Sun, 13 Jul 2014 22:45:26 +1000 Subject: [PATCH] Remove the src/test.rs implicit test. It's not unreasonable to have unittests in a separate submodule of the crate (being called `test` or `tests`), and having them in their own file can be very sensible. Thus, the `src/test.rs` implicit default is likely to trip up some perfectly reasonable use-cases. There's already the `tests/...` default, so repairing a codebase after this removal is just moving `src/test.rs` to `tests/whatever_name_you_want.rs`. Closes #187. --- src/cargo/util/toml.rs | 2 -- tests/test_cargo_test.rs | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cargo/util/toml.rs b/src/cargo/util/toml.rs index 44b40595f..ffed1d2e0 100644 --- a/src/cargo/util/toml.rs +++ b/src/cargo/util/toml.rs @@ -60,8 +60,6 @@ pub fn project_layout(root: &Path) -> Layout { try_add_files(&mut examples, root, "examples"); - // support two styles of tests: src/test.rs or tests/*.rs - try_add_file(&mut tests, root, "src/test.rs"); try_add_files(&mut tests, root, "tests"); Layout { diff --git a/tests/test_cargo_test.rs b/tests/test_cargo_test.rs index 85129fa1f..9dc1c91d3 100644 --- a/tests/test_cargo_test.rs +++ b/tests/test_cargo_test.rs @@ -194,7 +194,7 @@ test!(external_test_implicit { #[test] fn internal_test() {} "#) - .file("src/test.rs", r#" + .file("tests/external.rs", r#" extern crate foo; #[test] -- 2.30.2